<?php

if(!extension_loaded('curl')) 
  die("this script requires the curl extension<br />see: <a href=\"http://www.php.net/manual/en/ref.curl.php\">http://www.php.net/manual/en/ref.curl.php</a>"); 

  abstract class Proxy {
    protected $curl;
    
    protected function Proxy(){

      $this->curl = curl_init();
    
      curl_setopt($this->curl, CURLOPT_HEADER, 0);
      curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($this->curl, CURLOPT_POST, 0);

    }
    
    protected function __destructor() {
      curl_close($this->curl);
    }

    public static function send($whatToSend='', $format='xml') {
     
     header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
     header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
     header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
     header ("Pragma: no-cache"); // HTTP/1.0
     if($format=='xml') header ("Content-Type: text/xml");
     else header("Content-Type: text/html");
     
     echo $whatToSend;
    }
    
    protected abstract  function sendResult();
    protected abstract  function search();
  }


?>
